#include "comiocontroller.h"


ComIOController* ComIOController::_instance = NULL;

ComIOController::ComIOController(QObject *parent) :
    QObject(parent),
    cin(stdin, QIODevice::ReadOnly),
    cout(stdout, QIODevice::WriteOnly),
    cerr(stderr, QIODevice::WriteOnly)
{

}

ComIOController* ComIOController::getInstance()
{
    if(_instance == NULL)
        _instance = new ComIOController();
    return _instance;
}


void ComIOController::msgOutput(QString msg, MSG_LEVEL level)
{
    cout << msg << endl;
}

void ComIOController::getInput(QString& buffer)
{
    buffer = cin.readLine();
}
